using System;
using System.Collections.Generic;

using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;

#endif

public class TagMaskAttribute : PropertyAttribute
{
}

#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(TagMaskAttribute))]
public class TagMaskDrawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        Debug.Log(LayerMask.GetMask("Enemy"));
        List<string> layers = new List<string>(UnityEditorInternal.InternalEditorUtility.layers);
        layers.Insert(0, "placeholder");  // 不知道为什么实际使用多算一层
        property.intValue = EditorGUI.MaskField(position, label, property.intValue, UnityEditorInternal.InternalEditorUtility.layers);
        // Debug.Log(property.intValue);
        // property.intValue = EditorGUI.MaskField(position, label, property.intValue, UnityEditorInternal.InternalEditorUtility.tags);
    }

}
#endif